I'm going to do the buy properties in its own game and then I'm going to use the exact same style so
that it'll be easy to integrate into our other game if you want.
But you might want to just take this and put it into your own game.
So I figured I'd break that code out.
So this is an empty terrain right here.
There's nothing in it.
But I did give you guys some starter files, two of them.
I uploaded it to the resources section of this lecture.
Go ahead and download that.
It's called Property Scripts Managers, and it's a rbcm file.
I saved it off as a model.
And then go to your server script service.
Remember where you downloaded it to because we're going to right click insert from file and then you're
going to look for it on your computer.
Mine's queued up, right?
Because this is a video, so I'm going to get my property scripts managers, rbcm and I open it up and
I saved it off as a model because this is a module script and if I would have saved it off and uploaded
it, you would have got it as a regular script.
But we want a module script.
Let's just drag our game manager into server script service and then our property manager, which is
the module script in the server script service, and I'm going to get rid of that, that, that model.
All right, So now we have both of these scripts.
If you open property manager and you recall from your equipment manager, I used almost identical format
and I put notes in here so that you could follow along, right?
So if you were putting this into a game, you're going to put your finished property manager into that
game.
You shouldn't need to touch property manager at all.
Game manager is very similar to the one that we've been working on in our other game, in our zombie
game, and I even called it all the same stuff.
I basically just deleted the stuff I didn't need.
If you look right here, you're going to see we have a data store.
Uh oh.
What does that mean?
Let's go to home.
Game settings you might have to save your game off.
Mine is already saved off.
Then go to security.
Enable studio access to API services.
There we go.
And we're going to save it, right?
And if you scroll through this, you're going to see that this has all the same functions, right?
I did modify them and I put some notes in here.
Right.
Give player the property.
We don't have any of our daily streak stuff in here, but you could see where it would all go.
Let's go over to our scene and set up some lot stuff.
So I am at the home tab.
Let's go to model and then add a spawn location.
I'm going to put this in the center of the world for now.
So my spawn location is location is at.
Oh man, it's pretty far away.
I'm going to make it zero on the x 10.5 and the Y, that's for the terrain and then zero on the Z.
All right.
Where is it at?
Way over there.
I hit my F button and I framed in.
Now I need to get a lot.
Let's just add one lot.
We'll get the lot.
The way we want it.
And then we'll make more of them.
Right.
So let's get a lot here.
We'll call that lot.
It's a part.
Call it lot and let's change the size.
So the size of the lot will be about 50 by one.
By 50.
And let's position it and I want to position them equidistant from my spawn location just so they all
look kind of the same when you get in the game, because we're going to swap those lots out depending
on who's in the game.
Can't just keep making more lots for more players.
You might get somebody who buys a lot and never comes back.
So for position, I think I'll make that 110.5 because we want the terrain, height and then zero on
the Z.
Nice.
And we got to get rid of those blades.
That doesn't look very good.
I'll go to home and then editor edit paint, maybe hit ground and I'm not going to bother adjusting
anything.
I'm just going to eyeball it.
You can spend as much time on this as you want, but the videos got to be kind of short or you'll get
bored because I get bored when I watch long videos.
All right.
That's going to be good enough.
Yeah, fine.
Oh, my gosh.
I can't stop.
All right, now it's done.
All right, let's get rid of this.
And I want to make this into a model so the lots just apart.
Let's right click.
And now we'll go group as model.
And I'm going to call this player lot, right?
So that's the lot level.
We're going to put a few things in that lot.
We are going to need a tag for the owner.
So I'm going to hit this plus and I'm going to use a string value for just the owner name.
Some people put the hole, they use an object value and they put the whole player value in there.
But I think I'll just use the name.
So for the string value, I'm going to call that owner, right?
So string value right there.
Okay.
In case you missed it.
All right, now let's get a price.
So hit the plus sign again.
That's going to be an int value.
In value and I'll say price and we can actually add the price, let's say 5000.
So we'll do 5000, whatever, whatever metric you're using, we're using points, but we want to keep
this one empty because we're going to use code for that, whether they buy it or whether they enter
the game.
And we assign them a lot.
What else do we need?
Maybe some signs saying for sale.
And I put a sign in the resources, the one for the landmines, in case you don't have it.
If you don't have it, you can add it.
So just download it.
We'll right click and then insert from file.
And it should be called sign as the landmine sign from that video.
It's going to be like, who knows where in the world, though?
So I'm going to pause the video while I drag it way over there because I'm sure you don't want to watch
me do that.
All right.
So we got our sign right here.
It still says caution landmine.
And this says landmine.
Put it in your.
Your player lot model though and then change the name to for sale sign or something like that sale sign
I'll do for sale.
Sign for sale sign.
All right.
And then under sign we have some text.
Open that up, surface gooey, open that up text label.
Let's scroll down to where it says Caution minefield and we'll change it to for sale.
All right.
And on this sign right here on one of the parts, you can do it post or sign.
Let's add a proximity prompt.
Hit the plus.
Proximity prompt.
And that way when somebody goes up, we're going to turn it on and off.
If somebody owns it, it's not going to pop up.
But if somebody doesn't own the property, we want this to pop up and say, you know, by a lot, you
know, as a question.
So I'll say by prompt.
All right, what else do we need?
Let's add one more thing.
Player lot plus sign script.
We'll call this script.
By script.
We're going to do more than by a lot.
We're going to buy houses and parts and fence and stuff like that.
All right.
That's looking pretty good.
In the next video, we're going to start doing some coding.